package top.letscode.study.apollo;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import top.letscode.study.apollo.task.BizTask1;
import top.letscode.study.apollo.task.BizTask2;
import top.letscode.study.apollo.util.SleepUtil;

/**
 * @Author: zhengzhq
 * @Date: 2019-09-02 08:17
 * @Description: 程序入口
 */
public class Application {

    public static void main(String[] args) {
        System.setProperty("env", "RD");
        ClassPathXmlApplicationContext applicationContext =
            new ClassPathXmlApplicationContext("applicationContext.xml");

        applicationContext.start();

        // 启动1个业务线程
        new Thread(new BizTask1(), "Task-1").start();

        // 休眠2秒
        SleepUtil.sleepQuietly(2000);

        // 再启动一个业务线程
        new Thread(new BizTask2(), "Task-2").start();
    }
}
